#include <iostream>
#include <string>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>

const std::string pathname = "/home/oo_zz/2024-8-9/msg";
const int proj_id = 0x66;

key_t get_key()
{
    return ftok(pathname.c_str(), proj_id);
}
int create_msg(key_t key)
{
    return msgget(key, IPC_CREAT | 0666);
}